package turring;

import java.util.ArrayList;



public class Etat {


	private ArrayList<Transition> mesTransitions=new ArrayList<Transition>();
	private boolean terminal=false;
	
	public Etat()
	{
	
	}
	
	
	public ArrayList<Transition> getTransitions(char c)
	{
		ArrayList<Transition> retour=new ArrayList<Transition>();
		
		for(Transition t : mesTransitions)
		{
			if(t.transitionPossible(c))
			{
				retour.add(t);
			}
		}
		return retour;
	}
	
	public boolean estTerminal()
	{
		return terminal;
	}
	
	

	public void addTransition(Etat etat, char c, char d, int i) {
		mesTransitions.add(new Transition(c,d,etat,i));
	}


	public void setToTerminal() {
		// TODO Auto-generated method stub
		terminal=true;
	}
}
